<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="com.shopcz.pojo.*"%>

<!DOCTYPE html>
<html>
<head>

<title>二手网，你要的二货在此！</title>
<link rel="stylesheet" type="text/css" href="homepageAndDetail/css/topbar.css">
<script src="homepageAndDetail/js/jquery.min.js"></script>

</head>

<body marginwidth="0" marginheight="0">
<input type="hidden" value="${user_login.userName }" id="uuname" />
	<div id="commonTopbar" class="commonTopbar">
   <div id="commonTopbar_welcome" class="bar_left" style="margin-left:50px">
     <label><font size="4" color="skyblue" >${user_login.userName }</font>&nbsp;&nbsp;欢迎来到二手网！</label> 
   </div>
   <div class="bar_right" style="position:relative;margin-right:50px" id="info">
        <div id="commonTopbar_login">
           <a href="${pageContext.request.contextPath }/user_manage/user_login.jsp">登录
           </a>
           
        </div>   
        <div class="shopping_cart">
           <a id="car" target="_blank">购物车
           </a>
        </div>   
        <div class="post_order">
           <a id="fabu" target="_blank">发布商品
           </a>
        </div>        
        <div id="commonTopbar_my58menu" class="haschild">
           <a id="personcenter" target="_blank">个人中心
           </a>
        </div>
   </div> 
  
</div>
</body>
<script type="text/javascript">
	
	var uuname=$("#uuname").val();
	if(uuname!=null&&uuname!=""){
		$("#commonTopbar_login").hide();
		temp='<span style="color:#00A33B">欢迎：<strong>'+uuname+' </strong> 登录本系统！</span>';
		$("#info").append(temp);
	}
	$(function(){
		$("#car").click(function(){
			var len=$("#uuname").val();
			if(len!=null&&len!=""){
				window.location.href="${pageContext.request.contextPath}/carInfoServlet";
			}else{
				alert("您尚未登录，请先登录！");
				window.location.href="${pageContext.request.contextPath }/user_manage/user_login.jsp";
			}
		}); 
		
		$("#fabu").click(function(){
			var len=$("#uuname").val();
			if(len!=null&&len!=""){
				window.location.href="${pageContext.request.contextPath }/homepageAndDetail/fabu.jsp?uid=userid";
			}else{
				alert("您尚未登录，请先登录！");
				window.location.href="${pageContext.request.contextPath }/user_manage/user_login.jsp";
			}
		}); 
		
		$("#personcenter").click(function(){
			var len=$("#uuname").val();
			if(len!=null&&len!=""){
				window.location.href="${pageContext.request.contextPath }/person_center/right_menu.jsp";
			}else{
				alert("您尚未登录，请先登录！");
				window.location.href="${pageContext.request.contextPath }/user_manage/user_login.jsp";
			}
		}); 
	});
</script>
</html>